<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html><head><meta http-equiv="Content-Type" content="text/html;charset=iso-8859-1">
<title>PowerVR SDK</title>
<link href="doxygen.css" rel="stylesheet" type="text/css">
<link href="tabs.css" rel="stylesheet" type="text/css">
<table width="100%">
  <tr>
    <td width="33%">
      <p align="left">&nbsp;<a href="http://www.imgtec.com"><img border="0" src="IMGLogo.jpg" width="200" height="30"></a></p>
    </td>
    <td width="33%">
      <p align="center"><font color="#808080" face="Arial" size="2">PowerVR Software Development Kit</a></font></p>
    </td>
    <td width="34%">
      <p align="right"><a href="http://www.powervr.com"><img border="0" src="PVRlogo.jpg" width="200" height="27"></a></p>
    </td>
  </tr>
</table>
<hr>
</head><body>
<!-- Generated by Doxygen 1.3.6 -->
<div class="qindex"><a class="qindex" href="index.html">Main&nbsp;Page</a> | <a class="qindex" href="hierarchy.html">Class&nbsp;Hierarchy</a> | <a class="qindex" href="annotated.html">Class&nbsp;List</a> | <a class="qindex" href="files.html">File&nbsp;List</a> | <a class="qindex" href="functions.html">Class&nbsp;Members</a> | <a class="qindex" href="globals.html">File&nbsp;Members</a></div>
<h1>PVRTVertex.h</h1><a href="PVRTVertex_8h.html">Go to the documentation of this file.</a><div class="fragment"><pre>00001 <span class="comment">/******************************************************************************</span>
00002 <span class="comment"></span>
00003 <span class="comment"> @File         PVRTVertex.h</span>
00004 <span class="comment"></span>
00005 <span class="comment"> @Title        PVRTVertex</span>
00006 <span class="comment"></span>
00007 <span class="comment"> @Version      </span>
00008 <span class="comment"></span>
00009 <span class="comment"> @Copyright    Copyright (C)  Imagination Technologies Limited.</span>
00010 <span class="comment"></span>
00011 <span class="comment"> @Platform     ANSI compatible</span>
00012 <span class="comment"></span>
00013 <span class="comment"> @Description  Utility functions which process vertices.</span>
00014 <span class="comment"></span>
00015 <span class="comment">******************************************************************************/</span>
00016 <span class="preprocessor">#ifndef _PVRTVERTEX_H_</span>
00017 <span class="preprocessor"></span><span class="preprocessor">#define _PVRTVERTEX_H_</span>
00018 <span class="preprocessor"></span>
00019 <span class="preprocessor">#include "<a class="code" href="PVRTError_8h.html">PVRTError.h</a>"</span>
00020 
00021 <span class="comment">/****************************************************************************</span>
00022 <span class="comment">** Enumerations</span>
00023 <span class="comment">****************************************************************************/</span>
<a name="l00024"></a><a class="code" href="PVRTVertex_8h.html#a24">00024</a> <span class="keyword">enum</span> <a class="code" href="PVRTVertex_8h.html#a24">EPVRTDataType</a> {
00025     <a class="code" href="PVRTVertex_8h.html#a24a0">EPODDataNone</a>,
00026     <a class="code" href="PVRTVertex_8h.html#a24a1">EPODDataFloat</a>,
00027     <a class="code" href="PVRTVertex_8h.html#a24a2">EPODDataInt</a>,
00028     <a class="code" href="PVRTVertex_8h.html#a24a3">EPODDataUnsignedShort</a>,
00029     <a class="code" href="PVRTVertex_8h.html#a24a4">EPODDataRGBA</a>,
00030     <a class="code" href="PVRTVertex_8h.html#a24a5">EPODDataARGB</a>,
00031     <a class="code" href="PVRTVertex_8h.html#a24a6">EPODDataD3DCOLOR</a>,
00032     <a class="code" href="PVRTVertex_8h.html#a24a7">EPODDataUBYTE4</a>,
00033     <a class="code" href="PVRTVertex_8h.html#a24a8">EPODDataDEC3N</a>,
00034     <a class="code" href="PVRTVertex_8h.html#a24a9">EPODDataFixed16_16</a>,
00035     <a class="code" href="PVRTVertex_8h.html#a24a10">EPODDataUnsignedByte</a>,
00036     <a class="code" href="PVRTVertex_8h.html#a24a11">EPODDataShort</a>,
00037     <a class="code" href="PVRTVertex_8h.html#a24a12">EPODDataShortNorm</a>,
00038     <a class="code" href="PVRTVertex_8h.html#a24a13">EPODDataByte</a>,
00039     <a class="code" href="PVRTVertex_8h.html#a24a14">EPODDataByteNorm</a>,
00040     <a class="code" href="PVRTVertex_8h.html#a24a15">EPODDataUnsignedByteNorm</a>,
00041     <a class="code" href="PVRTVertex_8h.html#a24a16">EPODDataUnsignedShortNorm</a>,
00042     <a class="code" href="PVRTVertex_8h.html#a24a17">EPODDataUnsignedInt</a>
00043 };
00044 
00045 <span class="comment">/*****************************************************************************</span>
00046 <span class="comment">** Functions</span>
00047 <span class="comment">*****************************************************************************/</span>
00048 
00049 <span class="comment">/*!***************************************************************************</span>
00050 <span class="comment"> @Function          PVRTVertexRead</span>
00051 <span class="comment"> @Output            pV</span>
00052 <span class="comment"> @Input             pData</span>
00053 <span class="comment"> @Input             eType</span>
00054 <span class="comment"> @Input             nCnt</span>
00055 <span class="comment"> @Description       Read a vector</span>
00056 <span class="comment">*****************************************************************************/</span>
00057 <span class="keywordtype">void</span> <a class="code" href="PVRTVertex_8h.html#a19">PVRTVertexRead</a>(
00058     <a class="code" href="structPVRTVECTOR4f.html">PVRTVECTOR4f</a>        * <span class="keyword">const</span> pV,
00059     <span class="keyword">const</span> <span class="keywordtype">void</span>          * <span class="keyword">const</span> pData,
00060     <span class="keyword">const</span> EPVRTDataType eType,
00061     <span class="keyword">const</span> <span class="keywordtype">int</span>           nCnt);
00062 
00063 <span class="comment">/*!***************************************************************************</span>
00064 <span class="comment"> @Function          PVRTVertexRead</span>
00065 <span class="comment"> @Output            pV</span>
00066 <span class="comment"> @Input             pData</span>
00067 <span class="comment"> @Input             eType</span>
00068 <span class="comment"> @Description       Read an int</span>
00069 <span class="comment">*****************************************************************************/</span>
00070 <span class="keywordtype">void</span> <a class="code" href="PVRTVertex_8h.html#a19">PVRTVertexRead</a>(
00071     <span class="keywordtype">unsigned</span> <span class="keywordtype">int</span>        * <span class="keyword">const</span> pV,
00072     <span class="keyword">const</span> <span class="keywordtype">void</span>          * <span class="keyword">const</span> pData,
00073     <span class="keyword">const</span> EPVRTDataType eType);
00074 
00075 <span class="comment">/*!***************************************************************************</span>
00076 <span class="comment"> @Function          PVRTVertexWrite</span>
00077 <span class="comment"> @Output            pOut</span>
00078 <span class="comment"> @Input             eType</span>
00079 <span class="comment"> @Input             nCnt</span>
00080 <span class="comment"> @Input             pV</span>
00081 <span class="comment"> @Description       Write a vector</span>
00082 <span class="comment">*****************************************************************************/</span>
00083 <span class="keywordtype">void</span> <a class="code" href="PVRTVertex_8h.html#a21">PVRTVertexWrite</a>(
00084     <span class="keywordtype">void</span>                * <span class="keyword">const</span> pOut,
00085     <span class="keyword">const</span> EPVRTDataType eType,
00086     <span class="keyword">const</span> <span class="keywordtype">int</span>           nCnt,
00087     <span class="keyword">const</span> <a class="code" href="structPVRTVECTOR4f.html">PVRTVECTOR4f</a>  * <span class="keyword">const</span> pV);
00088 
00089 <span class="comment">/*!***************************************************************************</span>
00090 <span class="comment"> @Function          PVRTVertexWrite</span>
00091 <span class="comment"> @Output            pOut</span>
00092 <span class="comment"> @Input             eType</span>
00093 <span class="comment"> @Input             V</span>
00094 <span class="comment"> @Description       Write an int</span>
00095 <span class="comment">*****************************************************************************/</span>
00096 <span class="keywordtype">void</span> <a class="code" href="PVRTVertex_8h.html#a21">PVRTVertexWrite</a>(
00097     <span class="keywordtype">void</span>                * <span class="keyword">const</span> pOut,
00098     <span class="keyword">const</span> EPVRTDataType eType,
00099     <span class="keyword">const</span> <span class="keywordtype">unsigned</span> <span class="keywordtype">int</span>  V);
00100 
00101 <span class="comment">/*!***************************************************************************</span>
00102 <span class="comment"> @Function          PVRTVertexTangentBitangent</span>
00103 <span class="comment"> @Output            pvTan</span>
00104 <span class="comment"> @Output            pvBin</span>
00105 <span class="comment"> @Input             pvNor</span>
00106 <span class="comment"> @Input             pfPosA</span>
00107 <span class="comment"> @Input             pfPosB</span>
00108 <span class="comment"> @Input             pfPosC</span>
00109 <span class="comment"> @Input             pfTexA</span>
00110 <span class="comment"> @Input             pfTexB</span>
00111 <span class="comment"> @Input             pfTexC</span>
00112 <span class="comment"> @Description       Calculates the tangent and bitangent vectors for</span>
00113 <span class="comment">                    vertex 'A' of the triangle defined by the 3 supplied</span>
00114 <span class="comment">                    3D position coordinates (pfPosA) and 2D texture</span>
00115 <span class="comment">                    coordinates (pfTexA).</span>
00116 <span class="comment">*****************************************************************************/</span>
00117 <span class="keywordtype">void</span> <a class="code" href="PVRTVertex_8h.html#a22">PVRTVertexTangentBitangent</a>(
00118     <a class="code" href="structPVRTVECTOR3f.html">PVRTVECTOR3</a>         * <span class="keyword">const</span> pvTan,
00119     <a class="code" href="structPVRTVECTOR3f.html">PVRTVECTOR3</a>         * <span class="keyword">const</span> pvBin,
00120     <span class="keyword">const</span> <a class="code" href="structPVRTVECTOR3f.html">PVRTVECTOR3</a>   * <span class="keyword">const</span> pvNor,
00121     <span class="keyword">const</span> <span class="keywordtype">float</span>         * <span class="keyword">const</span> pfPosA,
00122     <span class="keyword">const</span> <span class="keywordtype">float</span>         * <span class="keyword">const</span> pfPosB,
00123     <span class="keyword">const</span> <span class="keywordtype">float</span>         * <span class="keyword">const</span> pfPosC,
00124     <span class="keyword">const</span> <span class="keywordtype">float</span>         * <span class="keyword">const</span> pfTexA,
00125     <span class="keyword">const</span> <span class="keywordtype">float</span>         * <span class="keyword">const</span> pfTexB,
00126     <span class="keyword">const</span> <span class="keywordtype">float</span>         * <span class="keyword">const</span> pfTexC);
00127 
00128 <span class="comment">/*!***************************************************************************</span>
00129 <span class="comment"> @Function          PVRTVertexGenerateTangentSpace</span>
00130 <span class="comment"> @Output            pnVtxNumOut         Output vertex count</span>
00131 <span class="comment"> @Output            pVtxOut             Output vertices (program must free() this)</span>
00132 <span class="comment"> @Modified          pui32Idx            input AND output; index array for triangle list</span>
00133 <span class="comment"> @Input             nVtxNum             Input vertex count</span>
00134 <span class="comment"> @Input             pVtx                Input vertices</span>
00135 <span class="comment"> @Input             nStride             Size of a vertex (in bytes)</span>
00136 <span class="comment"> @Input             nOffsetPos          Offset in bytes to the vertex position</span>
00137 <span class="comment"> @Input             eTypePos            Data type of the position</span>
00138 <span class="comment"> @Input             nOffsetNor          Offset in bytes to the vertex normal</span>
00139 <span class="comment"> @Input             eTypeNor            Data type of the normal</span>
00140 <span class="comment"> @Input             nOffsetTex          Offset in bytes to the vertex texture coordinate to use</span>
00141 <span class="comment"> @Input             eTypeTex            Data type of the texture coordinate</span>
00142 <span class="comment"> @Input             nOffsetTan          Offset in bytes to the vertex tangent</span>
00143 <span class="comment"> @Input             eTypeTan            Data type of the tangent</span>
00144 <span class="comment"> @Input             nOffsetBin          Offset in bytes to the vertex bitangent</span>
00145 <span class="comment"> @Input             eTypeBin            Data type of the bitangent</span>
00146 <span class="comment"> @Input             nTriNum             Number of triangles</span>
00147 <span class="comment"> @Input             fSplitDifference    Split a vertex if the DP3 of tangents/bitangents are below this (range -1..1)</span>
00148 <span class="comment"> @Return            PVR_FAIL if there was a problem.</span>
00149 <span class="comment"> @Description       Calculates the tangent space for all supplied vertices.</span>
00150 <span class="comment">                    Writes tangent and bitangent vectors to the output</span>
00151 <span class="comment">                    vertices, copies all other elements from input vertices.</span>
00152 <span class="comment">                    Will split vertices if necessary - i.e. if two triangles</span>
00153 <span class="comment">                    sharing a vertex want to assign it different</span>
00154 <span class="comment">                    tangent-space matrices. The decision whether to split</span>
00155 <span class="comment">                    uses fSplitDifference - of the DP3 of two desired</span>
00156 <span class="comment">                    tangents or two desired bitangents is higher than this,</span>
00157 <span class="comment">                    the vertex will be split.</span>
00158 <span class="comment">*****************************************************************************/</span>
00159 <a class="code" href="PVRTError_8h.html#a5">EPVRTError</a> <a class="code" href="PVRTVertex_8h.html#a23">PVRTVertexGenerateTangentSpace</a>(
00160     <span class="keywordtype">unsigned</span> <span class="keywordtype">int</span>    * <span class="keyword">const</span> pnVtxNumOut,
00161     <span class="keywordtype">char</span>            ** <span class="keyword">const</span> pVtxOut,
00162     <span class="keywordtype">unsigned</span> <span class="keywordtype">int</span>    * <span class="keyword">const</span> pui32Idx,
00163     <span class="keyword">const</span> <span class="keywordtype">unsigned</span> <span class="keywordtype">int</span>  nVtxNum,
00164     <span class="keyword">const</span> <span class="keywordtype">char</span>      * <span class="keyword">const</span> pVtx,
00165     <span class="keyword">const</span> <span class="keywordtype">unsigned</span> <span class="keywordtype">int</span>  nStride,
00166     <span class="keyword">const</span> <span class="keywordtype">unsigned</span> <span class="keywordtype">int</span>  nOffsetPos,
00167     EPVRTDataType   eTypePos,
00168     <span class="keyword">const</span> <span class="keywordtype">unsigned</span> <span class="keywordtype">int</span>  nOffsetNor,
00169     EPVRTDataType   eTypeNor,
00170     <span class="keyword">const</span> <span class="keywordtype">unsigned</span> <span class="keywordtype">int</span>  nOffsetTex,
00171     EPVRTDataType   eTypeTex,
00172     <span class="keyword">const</span> <span class="keywordtype">unsigned</span> <span class="keywordtype">int</span>  nOffsetTan,
00173     EPVRTDataType   eTypeTan,
00174     <span class="keyword">const</span> <span class="keywordtype">unsigned</span> <span class="keywordtype">int</span>  nOffsetBin,
00175     EPVRTDataType   eTypeBin,
00176     <span class="keyword">const</span> <span class="keywordtype">unsigned</span> <span class="keywordtype">int</span>  nTriNum,
00177     <span class="keyword">const</span> <span class="keywordtype">float</span>     fSplitDifference);
00178 
00179 
00180 <span class="preprocessor">#endif </span><span class="comment">/* _PVRTVERTEX_H_ */</span>
00181 
00182 <span class="comment">/*****************************************************************************</span>
00183 <span class="comment"> End of file (PVRTVertex.h)</span>
00184 <span class="comment">*****************************************************************************/</span>
00185 
</pre></div><br>
<br>
<P align=left><FONT size=2><STRONG><A 
   href="http://www.imgtec.com/powervr/insider/legal/index.asp">Copyright</A> � 
   1999-2008, Imagination Technologies Ltd.</STRONG></FONT></P>
<hr>
<address style="align: left;"><small><FONT color=f0f>
Generated by <a href="http://www.doxygen.org/index.html">DOXYGEN</a> 1.3.6</small></address>
</body>
</html>
